<!DOCTYPE html>
<#assign ctx=request.contextPath>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${ctx}/css/style.css" />
    <script type="text/javascript" src="${ctx}/js/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="${ctx}/js/jquery-migrate-1.2.1.js"></script>
    <script src="${ctx}/js/artDialog-6.0.2/dist/dialog-min.js"></script>
	<link rel="stylesheet" href="${ctx}/js/artDialog-6.0.2/css/ui-dialog.css">
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
    <script type="text/javascript">
            function deletes(code){
            
			    		var d = dialog({
							title:code,
						    content: '<img src=${ctx}/images/logo3.jpg style="width:200px;height:124px;"><br><font size=3 color=red>您确定要删除对应的数据吗?</font>',
						    okValue:'确定',
						    ok:function(){
						    	this.title("请稍等...");
						    	window.location="${ctx}/admin/goodsType/deleteGoodsType?code="+code;
						    	return false;
						    },
						    cancelValue:'取消',
						    cancel:function(){}
						});
						d.showModal();
    	        };
	       $(function(){
    	        $("#addGoodsType").click(function(){
	                   window.location="${ctx}/admin/goodsType/showAddGoodsType";
	             });    
	       });
    	<#if tip??>
		/** 监听文档加载完事件 */
		$(function(){
			if("${tip}"!= null){
				var d = dialog({
					title: '温馨提示',
				    content: '<img src=${ctx}/images/logo3.jpg style="width:200px;height:124px;"><br><font size=3 color=red>${tip}</font>'
				});
				d.show();
				setTimeout(function () {
				    d.close().remove();
				}, 2000);
			};
		});
		</#if>
    </script>
</head>
<body>
<form class="form-inline definewidth m20" action="${ctx}/admin/goodsType/goodsTypeList?" method="post">    
    商品类型：
    <input type="text" name="code" id="code"class="abc input-default" placeholder="" value="">&nbsp;&nbsp;  
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addGoodsType">新增商品类型</button>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>商品类型编号</th>
        <th>商品类型名称</th>
        <th>商品类型备注</th>
        <th colspan="2" style="text-align:center">操作</th>
    </tr>
    </thead>
         <#if goodsTypeList??>
         <#list goodsTypeList as goodsType>
	     <tr>
            <td>${goodsType.code}</td>
            <td>${goodsType.name}</td>
            <td>${goodsType.remark}</td>
            <td>
                  <a href="${ctx}/admin/goodsType/showUpdate?code=${goodsType.code}">修改</a>
            </td>
             <td>
                  <a href="javascript:;" onclick="deletes('${goodsType.code}')">删除</a>
             </td>
        </#list>
        </#if>	
</table>
</body>
</html>